package oppsa.util;

import java.awt.Color;
import java.awt.Component;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import oppsa.view.JTableModel;

public class CustomCellRenderer extends DefaultTableCellRenderer {
    DateFormat formatter=new SimpleDateFormat("dd/MM/yyyy");;
    /*public CloseRenderer() {
        super();
    }*/
	@Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JTableModel model = (JTableModel) table.getModel();
        Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        if(model.getValueAt(row, 13 ).toString().equals("Closed")){
        	c.setForeground(Color.gray);
        } else {
        	c.setForeground(Color.red);
        }
        
        return c;
    }

}